#ifndef BREAKVIGENERE_H
#define BREAKVIGENERE_H

#include <QThread>

class CaesarBreak;

class BreakVigenere : public QThread
{
    Q_OBJECT
public:
    explicit BreakVigenere(QByteArray alphabet, QList<qreal> langFrequencies, int keyLenght, QByteArray input, bool doXor = false, QObject *parent = 0);
    
    void run();
signals:
    void done(QByteArray key, QByteArray plaintext);
    
public slots:
    void caesarDone(char key, QByteArray plain);

protected:

private:
    QByteArray alphabet;
    QList<qreal> langFrequencies;
    int keyLenght;
    QByteArray input;
    bool doXor;

    QList<QByteArray> columns;
    QByteArray keys;
    QList<CaesarBreak*> workers;
};

#endif // BREAKVIGENERE_H
